precision highp float;

uniform sampler2D u_src;

varying vec2 v_uv;


vec4 texture2Dclamp (sampler2D tex, vec2 uv) {
    vec4 color = texture2D(tex, uv);
    uv = step(vec2(0.0), uv) * step(uv, vec2(1.0));
    return color * uv[0] * uv[1];
}

vec4 texture2DclampToEdge (sampler2D tex, vec2 uv) {
    return texture2D(tex, clamp(uv, 0.0, 1.0));
}

vec4 texture2DclampToBorder (sampler2D tex, vec2 uv, vec4 border) {
    vec4 color = texture2D(tex, uv);
    uv = step(vec2(0.0), uv) * step(uv, vec2(1.0));
    return mix(border, color, uv[0] * uv[1]);
}

vec4 texture2Drepeat (sampler2D tex, vec2 uv) {
    return texture2D(tex, fract(uv));
}

vec4 texture2Dmirror (sampler2D tex, vec2 uv) {
    uv = mod(uv, 2.0);
    uv = mix(uv, 2.0 - uv, step(vec2(1.0), uv));
    return texture2D(tex, fract(uv));
}


void main () {
    gl_FragColor = texture2Dmirrir(u_src, uv);
}
